<?php
	if(isset($_GET['email']))
	{
		require_once '../config/config.php';
		$scheduleHtml = getSchedule($_GET['email']);
		
		echo $scheduleHtml;
		exit;
	}
?>

<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>KdGCal</title>
	<link href="/css/bootstrap.min.css" media="screen" rel="stylesheet" />
	<link href="/css/bootstrap.responsive.min.css" media="screen" rel="stylesheet" />
	<link href="/css/screen.css" media="screen, projection" rel="stylesheet" />
	<link href="/css/print.css" media="print" rel="stylesheet" />
	<!--[if IE]>
		<link href="/css/ie.css" media="screen, projection" rel="stylesheet" />
	<![endif]-->
</head>
<body>
	<header>
		<center><h1>KdGCal</h1></center>
	</header>
	
	<div style="margin-left: auto; margin-right: auto; width: 250px; ">
	<div class="input-append">
		<input class="span2" id="emailInputButton" type="text">
		<span class="add-on">@student.kdg.be</span>
	</div>
	
		<button class="btn btn-primary" type="button" id="btnAction">Get me my iCal</button>
	</div>
	
	<script src="http://code.jquery.com/jquery-latest.js"></script>
	<script src="/js/bootstrap.min.js"></script>
	<script src="/js/modernizr.custom.31984.js"></script>
	<script>
		$('#btnAction').click(function()
		{
			$.get('index.php?email=' + $('#emailInputButton').val(), function(data)
			{
				alert(data);
			});
		});
	</script>
</body>
</html>